var momObj = function(){
	this.x,this.y;
	this.angle;
	this.bigEye = new Image();
	this.bigBody = new Image();
	this.bigTail = new Image();
	//this.tails = [];
	this.tailTimer = 0;
	this.tailIndex = 0;

	this.eyeIndex = 0;
	this.eyeTimer = 0;
	this.eyeInterval=1000;

	this.bodyIndex = 0;

}
momObj.prototype.init = function(){
	this.x = canWidth * 0.5;
	this.y = canHeight * 0.5;
	this.angle = 0;
	this.bigEye.src = "./src/bigEye0.png";
	this.bigBody.src = "./src/big.png";
	//this.bigTail.src = "./src/bigTail0.png";
	// for(var i=0;i<8;i++){
	// 	mom.tails[i] = new Image();
	// 	mom.tails[i].src = "./src/bigTail"+i+".png";
	// }
}
momObj.prototype.draw = function(){
	//lerp x,y
	this.x = lerpDistance(mx,this.x,0.98);
	this.y = lerpDistance(my,this.y,0.98);

	//delta angle
	//Math.atan2(y,x)
	var deltaY = my - this.y;
	var deltaX = mx - this.x;
	var beta = Math.atan2(deltaY,deltaX) + Math.PI;//-PI,PI
	//lerp angle
	this.angle = lerpAngle(beta,this.angle,0.6);

	//tail
	this.tailTimer += deltaTime;
	if(this.tailTimer > 50){
		this.tailIndex = (this.tailIndex+1) % 8;
		this.tailTimer %= 50;
	}
	//eye
	this.eyeTimer += deltaTime;
	if(this.eyeTimer > this.eyeInterval){
		this.eyeIndex = (this.eyeIndex+1) % 2;
		this.eyeTimer %= this.eyeInterval;
		if(this.eyeIndex == 0){
			this.eyeInterval = Math.random() * 1500 + 2000;//[）
		}else{
			this.eyeInterval = 200;
		}
	}

	ctx1.save();
	ctx1.translate(this.x,this.y);
	ctx1.rotate(this.angle);
	this.bigTail.src = "./src/bigTail"+this.tailIndex+".png";// = this.tails[this.tailIndex];
	ctx1.drawImage(this.bigTail,-this.bigTail.width*0.5+30,-this.bigTail.height*0.5);
	if (data.double==1) {
		this.bigBody.src = "./src/bigSwim"+this.bodyIndex+".png";
	}else{
		this.bigBody.src = "./src/bigSwimBlue"+this.bodyIndex+".png";
	}
	ctx1.drawImage(this.bigBody,-this.bigBody.width*0.5,-this.bigBody.height*0.5);	
	this.bigEye.src = "./src/bigEye"+this.eyeIndex+".png";
	ctx1.drawImage(this.bigEye,-this.bigEye.width*0.5,-this.bigEye.height*0.5);	
	ctx1.restore();
}